Rename OpenSearch qiprofile parameter back to profile
authorErik Bernhardson <ebernhardson@wikimedia.org>
Thu, 28 Jul 2016 17:15:07 +0000 (10:15 -0700)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Thu, 28 Jul 2016 17:25:33 +0000 (10:25 -0700)
In I6f987db this parameter was inadvertantly renamed to qiprofile. The
qiprofile is something different, and is also a BC break. The BC break is
pretty minor, for a randomly chosen day this looks to be used 157 times
out of 28.7M requests, but since this really isn't a qiprofile rename
it back to what it was.

Change-Id: I1cc07945888c15ea4b4c9596eea447b706606fae

includes/api/ApiOpenSearch.php
tests/phpunit/includes/api/ApiOpenSearchTest.php

index b13ba58..ace776c 100644 (file)
@@ -294,7 +294,7 @@ class ApiOpenSearch extends ApiBase {
 
        public function getSearchProfileParams() {
                return [
-                       'qiprofile' => [
+                       'profile' => [
                                'profile-type' => SearchEngine::COMPLETION_PROFILE_TYPE,
                                'help-message' => 'apihelp-query+prefixsearch-param-profile'
                        ],
index fd5b3a9..39e90c2 100644 (file)
@@ -30,8 +30,8 @@ class ApiOpenSearchTest extends MediaWikiTestCase {
                $params = $api->getAllowedParams();
 
                $this->assertArrayNotHasKey( 'offset', $params );
-               $this->assertArrayHasKey( 'qiprofile', $params, print_r( $params, true ) );
-               $this->assertEquals( 'normal', $params['qiprofile'][ApiBase::PARAM_DFLT] );
+               $this->assertArrayHasKey( 'profile', $params, print_r( $params, true ) );
+               $this->assertEquals( 'normal', $params['profile'][ApiBase::PARAM_DFLT] );
        }
 
        private function replaceSearchEngineConfig() {